//
//  NewsFeedTableViewCell.m
//  Mecca
//
//  Created by Ryan Enguero on 6/3/14.
//  Copyright (c) 2014 TapDash Heuristics. All rights reserved.
//

#import "NewsFeedTableViewCell.h"

@implementation NewsFeedTableViewCell

- (void)awakeFromNib
{
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setImageString:(NSString *)strImage{
    
    NSString *strImg = [NSString stringWithFormat:@"http://192.185.93.102/~boomeran/backend-panel/%@",strImage];
    
    [NSThread detachNewThreadSelector:@selector(showImage:) toTarget:self withObject:strImg];
    
}

-(void)showImage:(NSString*)imageShow{
    @autoreleasepool {
        NSData *imageList = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageShow]];
        [self.newsFeedImg setAlpha:0];
        [UIView animateWithDuration:1 animations:^{
             
                UIImage *image = [UIImage imageWithData:imageList];
            
            
//            if (!image) {
                self.newsFeedImg.image = image;
                [self.activityView setHidden:YES];
                [self.newsFeedImg setAlpha:1];

//            }
            
            
        } completion:^(BOOL finished) {
            
        }];
        
        
        //[self animationActivity];
    }
}

@end
